
package com.weiqiao.mall.service.impl;


import com.mingsoft.util.StringUtil;
import com.weiqiao.base.entity.ManagerDtoEntity;
import com.weiqiao.mall.domain.TreeNodeEntity;
import com.weiqiao.mall.service.IBaseWeiXinService;

import java.util.List;


/**
 * 基础业务实现
 *
 * @author Scott.fan
 */
public abstract class BaseWeiXinServiceImpl implements IBaseWeiXinService {

    public String getTreeName(String nodeid, List<TreeNodeEntity> list) {
        String name = "";
        if (!StringUtil.isBlank(nodeid)) {
            for (TreeNodeEntity inf : list) {
                if (nodeid.equals(inf.getNodeid())) {
                    name = inf.getName();
                    break;
                }
            }
        }
        return name;
    }

    /**
     * 内存数据里面查询管理员名称
     *
     * @param userId
     * @param managerList
     * @return
     */
    public String getManagerDtoName(int userId, List<ManagerDtoEntity> managerList) {
        String name = "";
        for (ManagerDtoEntity user : managerList) {
            if (userId == user.getManagerId()) {
                name = user.getManagerNickName();
                break;
            }
        }
        return name;
    }
}
